@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
  font-family: 'Inter', sans-serif;
  background: #f9fafb;
  color: #111827;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
}
header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
header .intro {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1rem;
  opacity: 0.9;
}

/* Container */
.container {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 1.5rem;
  width: 90%;
  max-width: 800px; /* match content width */
  margin: 2rem auto;
  display: flex;
  justify-content: center;
}

.generator-inner {
  width: 100%;
  max-width: 500px; /* center internal content */
}

/* Output */
.output-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.output-box input {
  flex: 1;
  font-size: 1.2rem;
  padding: 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
}
.icon-btn {
  background: #f3f4f6;
  border: none;
  padding: 0.6rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.2rem;
}
/* 🎲 Generate Button Animation */
.icon-btn.generate {
  transition: transform 0.2s ease;
}

.icon-btn.generate.animate {
  animation: spin-bounce 0.6s ease;
}

@keyframes spin-bounce {
  0%   { transform: rotate(0deg) scale(1); }
  30%  { transform: rotate(180deg) scale(1.2); }
  60%  { transform: rotate(300deg) scale(0.9); }
  100% { transform: rotate(360deg) scale(1); }
}

.copy-btn {
  background: #facc15;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

/* Strength */
.strength-container { margin: 1rem 0; }
#strengthLabel { font-size: 0.9rem; margin-bottom: 0.3rem; }
.strength-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
#strengthBarFill {
  height: 100%;
  width: 0%;
  background: red;
  transition: width 0.3s ease, background 0.3s ease;
}

/* Slider */
.slider-container { margin: 1rem 0; }
#wordCountRange { width: 100%; }
#wordCountLabel { display: block; font-weight: 600; margin-bottom: 0.3rem; }

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}
.separators {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}
.sep-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  cursor: pointer;
}
.sep-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* Toast */
#toast {
  visibility: hidden;
  min-width: 220px;
  background: #111827;
  color: #fff;
  text-align: center;
  border-radius: 0.5rem;
  padding: 0.8rem;
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 30px;
  font-size: 0.95rem;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.5s ease, bottom 0.5s ease;
}
#toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px;
}

/* Content */
.content {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.content h2 { margin: 1.5rem 0 0.5rem; color: #1e3a8a; }

/* Footer */
footer {
  text-align: center;
  margin-top: auto;
  padding: 1.2rem;
  background: #f1f5f9;
  font-size: 0.9rem;
  color: #555;
}
footer a { color: #2563eb; text-decoration: none; margin: 0 0.5rem; }
footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 600px) {
  header h1 { font-size: 1.6rem; }
  .container { padding: 1rem; }
  .generator-inner { max-width: 100%; }
  .output-box input { font-size: 1rem; }
}


/* 🎲 Password fade animation */
@keyframes fadeOutIn {
  0%   { opacity: 1; }
  40%  { opacity: 0; }
  60%  { opacity: 0; }
  100% { opacity: 1; }
}
#passwordDisplay.animate-text {
  animation: fadeOutIn 0.8s ease;
}

/* 📋 Copy flash animation */
#passwordDisplay.flash {
  border: 2px solid #16a34a !important; /* green glow */
  box-shadow: 0 0 6px #16a34a;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

